﻿<navigation:Page xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  x:Class="Candy.ImportPage" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="954" d:DesignHeight="720"
           Title="ImportPage Page">
    <Grid x:Name="LayoutRoot" DataContext="{Binding Import, Mode=OneWay, Source={StaticResource Locator}}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="91*"/>
            <ColumnDefinition Width="229*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="2*"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="3*"/>
        </Grid.RowDefinitions>
        <TextBox Margin="10,10,0,0" TextWrapping="Wrap" Text="{Binding ImportData, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" AcceptsReturn="True" Grid.ColumnSpan="2" Grid.Row="1"/>
        <Button Content="Validate" HorizontalAlignment="Left" Height="30" Margin="10,10,0,0" Grid.Row="2" VerticalAlignment="Top" Width="106" Command="{Binding ValidateImport, Mode=OneWay}"/>

        <sdk:DataGrid Margin="10,10.414,10,9.586" Grid.Row="4" ItemsSource="{Binding Operations}" Grid.ColumnSpan="2">
            <sdk:DataGrid.Columns>
                <sdk:DataGridTextColumn IsReadOnly="True" Header="Action" Binding="{Binding Action}">

                </sdk:DataGridTextColumn>
                <sdk:DataGridTextColumn IsReadOnly="True" Header="Entity" Binding="{Binding PayloadType}">

                </sdk:DataGridTextColumn>
                <sdk:DataGridTextColumn IsReadOnly="True" Header="Name" Binding="{Binding Payload}">

                </sdk:DataGridTextColumn>
                <sdk:DataGridTextColumn IsReadOnly="True" Header="Message" Binding="{Binding Message}">

                </sdk:DataGridTextColumn>
            </sdk:DataGrid.Columns>
            <!--<DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding  Action}" />
                        <TextBlock Text="{Binding  PayloadType}" />
                        <TextBlock Text="{Binding  Payload}" />
                        <TextBlock Text="{Binding  Message}" />
                    </StackPanel>
                </DataTemplate>
                </sdk:DataGrid.ItemTemplate>-->
        </sdk:DataGrid>
        <TextBlock Margin="10,11,0,0" TextWrapping="Wrap" Text="Import Text" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="{StaticResource HeaderFontSize}" Height="28" Width="109"/>
        <TextBlock Margin="10,10,0,10" TextWrapping="Wrap" Text="Actions" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="{StaticResource HeaderFontSize}" Grid.Row="3" Grid.ColumnSpan="2"/>
        <Button Content="Import" HorizontalAlignment="Left" Height="30" Margin="133,10,0,0" Grid.Row="2" VerticalAlignment="Top" Width="106" Command="{Binding Import, Mode=OneWay}"/>

    </Grid>
</navigation:Page>
